package meiyunting.shiwuzhaoling.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 熔断器可视化控制器
 * 提供页面，用于可视化展示熔断器功能
 */
@Slf4j
@Controller
@RequestMapping("/circuit-breaker")
public class CircuitBreakerViewController {

    @Value("${server.port}")
    private String serverPort;
    
    /**
     * 显示熔断器测试页面
     */
    @GetMapping("")
    public String showCircuitBreakerPage(Model model) {
        model.addAttribute("currentPort", serverPort);
        return "circuit-breaker";
    }
} 